<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <meta name="renderer" content="webkit">
    <title><?php echo ($title); ?></title>
    <link rel="stylesheet" href="/Public/web/css/pintuer.css">
    <link rel="stylesheet" href="/Public/web/css/admin.css">
    <script src="/Public/web/js/jquery.js"></script>
    <script src="/Public/web/js/pintuer.js"></script>
</head>

<script type="text/javascript" language="javascript" src="/Public/admin/js/eye-base.js"></script>
<script type="text/javascript" language="javascript" src="/Public/admin/js/eye-all.js"></script>
<body>
<form action="" id="listform">
    <div class="panel admin-panel">
        <div class="panel-head"><strong class="icon-reorder"> <?php echo L("dingdanliebiao");?></strong></div>
        <div class="padding border-bottom">
            <ul class="search" style="padding-left:10px;">
                <li><a class="button border-main icon-plus-square-o" href="<?php echo U('goods/edit');?>"> <?php echo L("tianjia");?></a></li>
                <li><?php echo L("sousuo");?>：</li>
                <li>
                    <input type="text" placeholder="<?php echo L('qingshuru'); echo L('yonghuming');?>" name="user_name"
                           value="<?php echo ($get['nickName']); ?>" class="input"
                           style="width:250px; line-height:17px;display:inline-block"/>
                </li>
                <li>
                    <input type="text" placeholder="<?php echo L('qingshuru'); echo L('dingdanhao');?>" name="order_number"
                           value="<?php echo ($get['order_number']); ?>" class="input"
                           style="width:250px; line-height:17px;display:inline-block"/>
                </li>
                <li><?php echo L("shijianfanwei");?>：</li>
                <li><input class="input" type="text" name="start_time" value="<?php echo ($get['start_time']); ?>"
                           onClick="eye.datePicker.show(this);"/></li>
                <li>~</li>
                <li><input class="input" type="text" name="end_time" value="<?php echo ($get['end_time']); ?>"
                           onClick="eye.datePicker.show(this);"/></li>
                <li><input type="submit" value="<?php echo L('sousuo');?>" class="button border-main icon-search"/></li>
            </ul>
        </div>
        <table class="table table-hover text-center">
            <tr>
                <th width="300"><?php echo L("yonghuwangming");?></th>
                <th><?php echo L("dingdanhao");?></th>
                <th><?php echo L("dingdanhaoshangpin");?></th>
                <th><?php echo L("xiadanshijian");?></th>
                <th><?php echo L("chengjiaojine");?></th>
                <th width="200"><?php echo L("caozuo");?></th>
            </tr>
            <?php if(is_array($list)): foreach($list as $key=>$v): ?><tr class="tr<?php echo ($v['id']); ?>">
                    <td><?php echo ($v['nickname']); ?></td>
                    <td><?php echo ($v['order_number']); ?></td>
                    <td><?php echo ($v['goods_names']); ?></td>
                    <td><?php echo (date("Y-m-d H:i",$v['time'])); ?></td>
                    <td><?php echo ((isset($v['pay_money']) && ($v['pay_money'] !== ""))?($v['pay_money']):'--'); ?></td>
                    <td>
                        <?php if($v['status'] == 0): ?><span style="color: blue; cursor: pointer; text-decoration: underline;"
                                  onclick="is_pay(<?php echo ($v['id']); ?>,this)"><?php echo L("weifukuan");?></span>
                            <?php elseif($v['status'] == 1): ?>
                            <span style="color: green;"><?php echo L("yifukuan");?></span>
                            <?php elseif($v['status'] == 2): ?>
                            <span><?php echo L("yichuhuo");?></span>
                            <?php elseif($v['status'] == 3): ?>
                            <span style="color: red;"><?php echo L("yishixiao");?></span><?php endif; ?>
                    </td>
                    <td><a class="button border-main" href="<?php echo U('Order/edit',array('id'=>$v['id']));?>"><span
                            class="icon-edit"></span> <?php echo L("xiangqing");?></a></td>
                </tr><?php endforeach; endif; ?>
            <tr>
                <td colspan="10">
                    <div class="pagelist"><?php echo ($page); ?></div>
                </td>
            </tr>
        </table>
    </div>
</form>
<script type="text/javascript">

    function is_pay(id, t) {
        if (confirm("<?php echo L('gaiweizhifu');?>")) {
            var url = "<?php echo U('Order/is_pay');?>";
            $.getJSON(url, {id: id}, function (data) {
                if (data.result == 'yes') {
                    var p = $(t).parent();
                    $(t).remove();
                    p.prepend('<span style="color: green;"><?php echo L("yifukuan");?></span>');
                }
            })
        }
    }
</script>
</body>

</html>